/**
 * @description 建立后端的swagger信息
 */

const swaggerJSDoc = require('swagger-jsdoc')

const swaggerDefinition = {
    openapi: "3.0.0",
    info: {
        title: "视频后台API_swagger文档",
        version: "1.0.0",
        description:
            "根据swagger文档 阅读RESTfulAPI规则.",
        //   license: {
        //     name: "Licensed Under MIT",
        //     url: "https://spdx.org/licenses/MIT.html",
        //   },
        //   contact: {
        //     name: "JSONPlaceholder",
        //     url: "https://jsonplaceholder.typicode.com",
        //   },
    },
    servers: [
        {
            url: "http://192.168.18.57:3000/api",
            description: "Development server",
        },
    ],
    components: {
        securitySchemes: {
            bearerAuth: {
                type: 'http',
                scheme: 'bearer',
                bearerFormat: 'JWT',
            },
        },
    },
    security: [
        {
            bearerAuth: [],
        },
    ],

};
const options = {
    swaggerDefinition,
    apis: ['./router/*.js'],
    // 包含OpenAPI定义的文件路径apis: ['./routes/*.js'],
};

const swaggerspc = swaggerJSDoc(options)
module.exports = swaggerspc